package com.shtel.bss.saas.tenant.entity;

import java.util.Date;
import com.shtel.bss.saas.core.data.common.entiry.IAbsBaseEntity;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import com.shtel.bss.saas.core.base.spring.ApplicationContextUtil;
import com.shtel.bss.saas.tenant.entity.repository.ISysGlobalAuthRepository;

/**
 * 基础权限表
 * @author xiezhiwei 2020-02-05 21:09
 */
@Table(name = "SYS_GLOBAL_AUTH")
public class SysGlobalAuth extends IAbsBaseEntity<Long> {
	
    /**
     * 操作类型(1访问 2 其他)
     * 
     */
	@Column(name = "ACTION_TYPE")
	private byte actionType;
    /**
     * 权限编码
     * 
     */
	@Column(name = "AUTH_CODE")
	private String authCode;
    /**
     * 权限ID
     * 
     */
	@Id
	@Column(name = "AUTH_ID")
	private Long authId;
    /**
     * 权限名称
     * 
     */
	@Column(name = "AUTH_NAME")
	private String authName;
    /**
     * 排序
     * 
     */
	@Column(name = "AUTH_SORT")
	private Long authSort;
    /**
     * 类型(1 目录 2按钮)
     * 
     */
	@Column(name = "AUTH_TYPE")
	private Byte authType;
    /**
     * 后台对应url
     * 
     */
	@Column(name = "AUTH_URL")
	private String authUrl;
    /**
     * 创建时间
     * 
     */
	@Column(name = "CREATE_TIME")
	private Date createTime;
    /**
     * 创建人
     * 
     */
	@Column(name = "CREATE_USER_ID")
	private Long createUserId;
    /**
     * 描述
     * 
     */
	@Column(name = "DESCRIPTION")
	private String description;
    /**
     * 图标
     * 
     */
	@Column(name = "ICON")
	private String icon;
    /**
     * 删除标识(1已删除 0未删除)
     * 
     */
	@Column(name = "IS_DELETE")
	private Byte isDelete;
    /**
     * 是否不可修改(1:不可修改;0:可修改)
     * 
     */
	@Column(name = "IS_FINAL")
	private Byte isFinal;
    /**
     * 修改时间
     * 
     */
	@Column(name = "MODIFY_TIME")
	private Date modifyTime;
    /**
     * 修改人
     * 
     */
	@Column(name = "MODIFY_USER_ID")
	private Long modifyUserId;
    /**
     * 父级ID
     * 
     */
	@Column(name = "PARENT_ID")
	private Long parentId;
    /**
     * 前台route链接(GET:/USER/{userId})
     * 
     */
	@Column(name = "URL")
	private String url;

	public static ISysGlobalAuthRepository repository() {
		return (ISysGlobalAuthRepository) ApplicationContextUtil.getBean("sysGlobalAuthRepository");
	}
	
    public void setActionType(Byte actionType) {
    	this.actionType = actionType;
    }
    
    public Byte getActionType() {
	   return actionType;
    }
    
    public void setAuthCode(String authCode) {
    	this.authCode = authCode;
    }
    
    public String getAuthCode() {
	   return authCode;
    }
    
    public void setAuthId(Long authId) {
    	this.authId = authId;
    }
    
    public Long getAuthId() {
	   return authId;
    }
    
    public void setAuthName(String authName) {
    	this.authName = authName;
    }
    
    public String getAuthName() {
	   return authName;
    }
    
    public void setAuthSort(Long authSort) {
    	this.authSort = authSort;
    }
    
    public Long getAuthSort() {
	   return authSort;
    }
    
    public void setAuthType(Byte authType) {
    	this.authType = authType;
    }
    
    public Byte getAuthType() {
	   return authType;
    }
    
    public void setAuthUrl(String authUrl) {
    	this.authUrl = authUrl;
    }
    
    public String getAuthUrl() {
	   return authUrl;
    }
    
    public void setCreateTime(Date createTime) {
    	this.createTime = createTime;
    }
    
    public Date getCreateTime() {
	   return createTime;
    }
    
    public void setCreateUserId(Long createUserId) {
    	this.createUserId = createUserId;
    }
    
    public Long getCreateUserId() {
	   return createUserId;
    }
    
    public void setDescription(String description) {
    	this.description = description;
    }
    
    public String getDescription() {
	   return description;
    }
    
    public void setIcon(String icon) {
    	this.icon = icon;
    }
    
    public String getIcon() {
	   return icon;
    }
    
    public void setIsDelete(Byte isDelete) {
    	this.isDelete = isDelete;
    }
    
    public Byte getIsDelete() {
	   return isDelete;
    }
    
    public void setIsFinal(Byte isFinal) {
    	this.isFinal = isFinal;
    }
    
    public Byte getIsFinal() {
	   return isFinal;
    }
    
    public void setModifyTime(Date modifyTime) {
    	this.modifyTime = modifyTime;
    }
    
    public Date getModifyTime() {
	   return modifyTime;
    }
    
    public void setModifyUserId(Long modifyUserId) {
    	this.modifyUserId = modifyUserId;
    }
    
    public Long getModifyUserId() {
	   return modifyUserId;
    }
    
    public void setParentId(Long parentId) {
    	this.parentId = parentId;
    }
    
    public Long getParentId() {
	   return parentId;
    }
    
    public void setUrl(String url) {
    	this.url = url;
    }
    
    public String getUrl() {
	   return url;
    }
    
	@Override
	public Long getId() {
		return getAuthId();
	}

	@Override
	public void setId(Long id) {
		setAuthId(id);
	}
}